package com.hotel.tv.application.callback;

import com.autumn.domain.values.IntegerConstantItemValue;
import com.autumn.zero.common.library.application.callback.CommonDataDictionaryCallback;
import com.hotel.tv.constants.CommonDictionaryTypeConstant;
import com.hotel.tv.constants.FileUploadAttachmentTypeConstant;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

import java.util.Collection;
import java.util.Set;

/**
 * 公用字典回调
 * <p>
 * </p>
 *
 * @description TODO
 * @author: 老码农
 * @create: 2020-04-08 14:58
 **/
@Component
@Primary
public class CommonDataDictionaryCallbackImpl implements CommonDataDictionaryCallback {

    @Override
    public int getFileUploadAttachmentType() {
        return FileUploadAttachmentTypeConstant.COMMON_DATA_DICTIONARY;
    }

    @Override
    public String getFileUploadStartPath() {
        return "common/dic";
    }

    @Override
    public Set<String> getFileUploadLimitExtensions() {
        return null;
    }

    @Override
    public Long getFileUploadLimitSize() {
        return null;
    }

    @Override
    public String getModuleId() {
        return "CommonDataDictionary";
    }

    @Override
    public String getModuleName() {
        return "公用字典";
    }

    @Override
    public boolean exist(Integer value) {
        return CommonDictionaryTypeConstant.exist(value);
    }

    @Override
    public IntegerConstantItemValue getItem(Integer value) {
        return CommonDictionaryTypeConstant.getItem(value);
    }

    @Override
    public String getName(Integer value) {
        return CommonDictionaryTypeConstant.getName(value);
    }

    @Override
    public Collection<IntegerConstantItemValue> items() {
        return CommonDictionaryTypeConstant.items();
    }
}
